import { observable, action } from 'mobx';
import {persist} from 'mobx-persist';
import Models from "./models";

class Store{
    @persist('object',Models.Account) @observable current=new Models.Account;
    @persist @observable authorized = false;

    @action login = (username,password)=>{
        return new Promise((resolve,reject)=>{

        })
    }

    @action logout = ()=>{
        return new Promise((resolve,reject)=>{
            this.authorized = false;
            this.current = {};
            resolve()
        });
    }
}

export default new Store()